package com.cci.kangdao.controller;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.cci.kangdao.service.ServiceTechnicianFileManageService;
import com.cci.kangdao.utilTool.ParameterTool;

@Controller
@RequestMapping("/serviceTechnicianFileManage")
public class ServiceTechnicianFileManageController {

	
	@Autowired
	private ServiceTechnicianFileManageService serviceTechnicianFileManageService;
	
	/**
	 * 预览工牌
	 * @author: wang ying
	 * @since: 2021年11月3日 上午11:00:52
	 * @version: V1.0
	 */
	@RequestMapping(value = "/previewWorkCard.aspx", method = RequestMethod.POST)
	public void previewWorkCard(HttpServletResponse response) {

	    try {
			Map<String, Object> data = serviceTechnicianFileManageService.previewWorkCard();
			ParameterTool.writeSuccessResponse(response, data);
		} catch (Exception e) {
			ParameterTool.writeErrorResponse(response);
		}
	}

	/**
	 * 获取订单负责人技师列表及 技师的电子工牌
	 */
	@RequestMapping(value = "/getWorkCardListDetail.aspx", method = RequestMethod.POST)
	public void getWorkCardListDetail(HttpServletResponse response, HttpServletRequest request) {
		try {
			Map<String, Object> map = ParameterTool.getParameterRequest(request, true);
			Map<String, Object> data = serviceTechnicianFileManageService.getPreviewWorkCardDetail(map);
			ParameterTool.writeSuccessResponse(response, data);
		} catch (Exception e) {
			e.printStackTrace();
			ParameterTool.writeErrorResponse(response);
		}
	}
}
